package com.test.domain;

import java.util.HashSet;
import java.util.Set;

public class Priviledge {
	private Integer id;
	//一项权限可以有多个子权限
	private Set<Priviledge> subPriviledges =new HashSet<Priviledge>();
	//一个权限对应多个角色
	private Set<Role> roles= new HashSet<Role>();
	//一项权限，有其父权限
	private Priviledge parent;
	//权限的自有属性,权限的名字+权限对应的URL
	private String name;
	private String url;
	public Priviledge(){
	}
	public Priviledge(String name,String url,Priviledge parent){
		this.name = name;
		this.url = url;
		this.parent = parent;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Set<Priviledge> getSubPriviledges() {
		return subPriviledges;
	}
	public void setSubPriviledges(Set<Priviledge> subPriviledges) {
		this.subPriviledges = subPriviledges;
	}
	public Set<Role> getRoles() {
		return roles;
	}
	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}
	public Priviledge getParent() {
		return parent;
	}
	public void setParent(Priviledge parent) {
		this.parent = parent;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
}
